package com.project.core.controller;


import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.project.core.base.BaseController;
import com.project.core.model.Users;
import com.project.core.service.IUsersService;
/**
 * 首页Controller
 * @author 小满
 * @date 2014-08-30
 */
@Controller
public class IndexController extends BaseController {
	
	private static Logger logger = Logger.getLogger(IndexController.class);
	
	@Autowired
	private IUsersService usersService;
	
	@RequestMapping("index")
    public String index(final HttpServletRequest request) {
		logger.info("[Controller]IndexController Execute!");
		try {
			List<Users> userlist = usersService.getAllUser();
			request.setAttribute("userslist", userlist);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "index";
    }
	
}
